// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import router from './router';

import './styles/index.less' // global css
import axios from './axios/config';
import store from './store'

// 如果静态模式下引入静态接口
if(process.env.BRANCH_ENV == 'static') {
  require('./mock') // simulation data
}

import './icons' // icon
import './errorLog' // error log
import './permission' // permission control

Vue.prototype.axios = axios;

// 若是没有开启Devtools工具，在开发环境中开启，在生产环境中关闭
if (process.env.NODE_ENV === 'development') {
  Vue.config.devtools = true;
} else {
  Vue.config.devtools = false;
}

Vue.config.productionTip = false;
// 取消Vue所有的日志和警告
Vue.config.silent = false;

/* eslint-disable no-new */
window.VM = new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
});
